{% from "shuup/admin/macros/general.jinja" import content_block %}
{% from "shuup/admin/macros/multilanguage.jinja" import language_dependent_content_tabs %}
{% set category_form = form["base"] %}

{% call content_block(_("General Information"), "fa-info-circle") %}
    {% call(form, language, map) language_dependent_content_tabs(category_form) %}
        {{ bs3.field(category_form[map.name], widget_class="autoupdate-slug") }}
        {{ bs3.field(category_form[map.slug], widget_class="slugfield") }}
        {{ bs3.field(category_form[map.description]) }}
    {% endcall %}
    {{ bs3.field(category_form.parent) }}
    {{ bs3.field(category_form.ordering) }}
{% endcall %}

{% call content_block(_("Visibility"), "fa-eye") %}
    {{ bs3.field(category_form.status) }}
    {{ bs3.field(category_form.visibility) }}
    {{ bs3.field(category_form.visibility_groups) }}
    {{ bs3.field(category_form.visible_in_menu) }}
    {{ bs3.field(category_form.shops) }}
    <div class="form-group">
        <label class="control-label"></label>
        {% if category.pk %}
            <button class="btn btn-primary" onclick="copyVisibilityToProducts(event, $(this))">
                <i class="fa fa-clone"></i> {% trans %}Copy visibility settings to products{% endtrans %}
            </button>
        {% endif %}
    </div>
{% endcall %}

{% call content_block(_("Category Image"), "fa-camera") %}
    {{ bs3.field(category_form.image) }}
{% endcall %}
